// 信令状态回调
import 'package:app/core/rtc/impl/session.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';

import 'call_state.dart';
import 'signaling_state.dart';

typedef void OnSignalingCallback(SignalingState state);
//呼叫状态回调
typedef void OnCallStateCallback(Session session, CallState state);
//视频流回调
typedef void OnStreamStateCallback(Session session, MediaStream stream);
//其他事件回调
typedef void OnOtherCallback(Map<String, dynamic> event);
//数据管道消息回调
typedef void OnDataChannelMessageCallback(
    Session session, RTCDataChannel dc, RTCDataChannelMessage msg);
//数据管道回调
typedef void OnDataChannelCallback(Session session, RTCDataChannel dc);

//消息
typedef void OnMessageCallback(String msg);

class SignalingCallback {
  OnSignalingCallback onSignalingCallback;
  OnCallStateCallback onCallStateCallback;
  OnStreamStateCallback onLocalStream;
  OnStreamStateCallback onAddRemoteStream;
  OnStreamStateCallback onRemoveRemoteStream;
  OnOtherCallback onPeersUpdate;
  OnDataChannelMessageCallback onDataChannelMessageCallback;
  OnDataChannelCallback onDataChannelCallback;
  OnMessageCallback onMessageCallback;

  SignalingCallback(
      {this.onSignalingCallback,
      this.onCallStateCallback,
      this.onLocalStream,
      this.onAddRemoteStream,
      this.onRemoveRemoteStream,
      this.onPeersUpdate,
      this.onDataChannelMessageCallback,
      this.onDataChannelCallback,
      this.onMessageCallback});
}
